<?php

class Social_Plugin_Provider_Abstract
{
	protected $_name;

	protected $_plugin = null;

	protected $_options = array();

	public function __construct()
	{
		$this -> init();
	}

	public function init()
	{

	}

	public function getOptions()
	{
		return $this -> _options;
	}

	public function setOptions($options)
	{
		$this -> _options = $options;
		return $this;
	}

	public function setOption($name, $value)
	{
		$this -> _options[$name] = $value;
		return $his;
	}

	public function getOption($name, $default = null)
	{
		return isset($this -> _options[$name]) ? $this -> _options[$name] : $default;
	}

	public function getName()
	{
		if (null == $this -> _name)
		{
			$this -> _name = strtolower(str_replace('Social_Plugin_Provider_', '', get_class($this)));
		}
		return $this -> _name;
	}

	public function getPlugin()
	{
		return $this -> _plugin;
	}

	public function setPlugin($plugin)
	{
		$this -> _plugin = $plugin;
		return $this;
	}

}
